//
//  MessageTableCellView.m
//  cocoapodText
//
//  Created by apple on 16/9/16.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "ShiPei.h"
#import "MessageTableCellView.h"
#import <Foundation/Foundation.h>

@interface MessageTableCellView()
@end

@implementation MessageTableCellView
/**
 *  初始化视图属性
 *
 *  @param frame 视图frame
 *
 *  @return self
 */
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        //定制View
        self.backgroundColor = [UIColor clearColor];
        self.userInteractionEnabled = YES; //设置为NO后，不再响应touch方法
        self.multipleTouchEnabled = YES;
        //控制子视图不能超出父视图的范围
        self.clipsToBounds = YES;
        //添加子视图
        [self subView];
    }
    return self;
}

//子视图懒加载
-(void)subView{
    UIView *allBackView=[[UIView alloc]initWithFrame:[ShiPei CGRectMakeScale:10 :0 :780 :35]];
    [self addSubview:allBackView];
    [allBackView setUserInteractionEnabled:YES];
    [allBackView setBackgroundColor:[UIColor clearColor]];
    self.allBackView=allBackView;
    //名称100
    UILabel *itemName=[[UILabel alloc]initWithFrame:[ShiPei CGRectMakeScale:5 :0 :95 :35]];
    [allBackView addSubview:itemName];
    [itemName setText:@""];
    [itemName setTextColor:FUIColorFromRGB(0x333333)];
    [itemName setFont:[UIFont boldSystemFontOfSize:[ShiPei CGFloatMakeFontScaleWithPX:23]]];
    [itemName setTextAlignment:NSTextAlignmentLeft];
    self.itemName=itemName;
    //类型105
    UILabel *itemType=[[UILabel alloc]initWithFrame:[ShiPei CGRectMakeScale:100 :0 :75 :35]];
    [allBackView addSubview:itemType];
    [itemType setText:@""];
    [itemType setTextColor:FUIColorFromRGB(0x333333)];
    [itemType setFont:[UIFont boldSystemFontOfSize:[ShiPei CGFloatMakeFontScaleWithPX:23]]];
    [itemType setTextAlignment:NSTextAlignmentLeft];
    self.itemType=itemType;
    //时间165
    UILabel *itemTime=[[UILabel alloc]initWithFrame:[ShiPei CGRectMakeScale:175 :0 :145 :35]];
    [allBackView addSubview:itemTime];
    [itemTime setText:@""];
    [itemTime setTextColor:FUIColorFromRGB(0x333333)];
    [itemTime setFont:[UIFont boldSystemFontOfSize:[ShiPei CGFloatMakeFontScaleWithPX:23]]];
    [itemTime setTextAlignment:NSTextAlignmentLeft];
    self.itemTime=itemTime;
    //内容335
    UILabel *itemContent=[[UILabel alloc]initWithFrame:[ShiPei CGRectMakeScale:330 :0 :290 :35]];
    [allBackView addSubview:itemContent];
    [itemContent setText:@""];
    [itemContent setTextColor:FUIColorFromRGB(0x333333)];
    [itemContent setFont:[UIFont boldSystemFontOfSize:[ShiPei CGFloatMakeFontScaleWithPX:23]]];
    [itemContent setTextAlignment:NSTextAlignmentLeft];
    self.itemContent=itemContent;
    //值70
    UILabel *itemNumber=[[UILabel alloc]initWithFrame:[ShiPei CGRectMakeScale:620 :0 :55 :35]];
    [allBackView addSubview:itemNumber];
    [itemNumber setText:@""];
    [itemNumber setTextColor:FUIColorFromRGB(0x333333)];
    [itemNumber setFont:[UIFont boldSystemFontOfSize:[ShiPei CGFloatMakeFontScaleWithPX:23]]];
    [itemNumber setTextAlignment:NSTextAlignmentCenter];
    self.itemNumber=itemNumber;
    
    //值70
    UILabel *itemNumber2=[[UILabel alloc]initWithFrame:[ShiPei CGRectMakeScale:675 :0 :55 :35]];
    [allBackView addSubview:itemNumber2];
    [itemNumber2 setText:@""];
    [itemNumber2 setTextColor:FUIColorFromRGB(0x333333)];
    [itemNumber2 setFont:[UIFont boldSystemFontOfSize:[ShiPei CGFloatMakeFontScaleWithPX:23]]];
    [itemNumber2 setTextAlignment:NSTextAlignmentCenter];
    self.itemNumber2=itemNumber2;
    
    //值70
    UILabel *itemStatus=[[UILabel alloc]initWithFrame:[ShiPei CGRectMakeScale:730 :0 :50 :35]];
    [allBackView addSubview:itemStatus];
    [itemStatus setText:@""];
    [itemStatus setTextColor:FUIColorFromRGB(0x333333)];
    [itemStatus setFont:[UIFont boldSystemFontOfSize:[ShiPei CGFloatMakeFontScaleWithPX:23]]];
    [itemStatus setTextAlignment:NSTextAlignmentCenter];
    self.itemStatus=itemStatus;
    
}

-(void)setName:(NSString *)name{
    [self.itemName setText:name];
}

-(void)setType:(NSString *)type{
    [self.itemType setText:type];
}

-(void)setTime:(NSString *)time{
    [self.itemTime setText:time];
}

-(void)setContent:(NSString *)content{
    [self.itemContent setText:content];
}

-(void)setNumber:(NSString *)number{
    [self.itemNumber setText:number];
}

-(void)setNumber2:(NSString *)number2{
    [self.itemNumber2 setText:number2];
}

-(void)setStatus:(NSString *)status{
    [self.itemStatus setText:status];
}
@end
